package encaps.utils.rendering;

import static encaps.utils.html.HTML.*;
import encaps.utils.html.HTMLElement;

public class TextFieldFactory extends TextControlFactory {

    @Override
    protected HTMLElement createTextControl(String name, String value) {
        HTMLElement control = new HTMLElement(INPUT);
        control.addAttribute(TYPE, TEXT);
        control.addAttribute(SIZE, DEFAULT_INPUT_SIZE);
        control.addAttribute(NAME, name);
        if (value != null) {
            control.addAttribute(VALUE, value);
        }
        return control;
    }
}
